package com.cg.design.graphicdesignpattern.visitor;

import java.util.ArrayList;

/**
 * 用于将Entry类及其子类添加到ElementArrayList中
 *
 * @program: LeetCode->ElementArrayList
 * @description: 用于将Entry类及其子类添加到ElementArrayList中
 * @author: cg
 * @create: 2022-03-26 23:40
 **/
public class ElementArrayList extends ArrayList<Entry> implements Element {
    @Override
    public void accept(Visitor visitor) {
        for (Entry entry : this) {
            entry.accept(visitor);
        }
    }
}
